package com.naiterui.ehp.bs.emr.vo.health;

import com.naiterui.ehp.bp.support.exception.BusinessException;
import com.naiterui.ehp.bs.emr.exception.ExceptionCodes;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * @Description 健康档案
 * @Author gongbaoqiang
 * @Date 2020/6/2 2:22 PM
 */
@Data
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("基本信息")
public class BaseInfoVO implements Serializable {
    private static final long serialVersionUID = 5755248327345781934L;

    @ApiModelProperty("身高")
    private String height;

    @ApiModelProperty("体重")
    private String weight;

    @ApiModelProperty("体温")
    private String temperature;

    @ApiModelProperty("心率")
    private String heartRate;

    @ApiModelProperty("收缩压（高压）")
    private String highPressure;

    @ApiModelProperty("舒张压（低压）")
    private String lowPressure;

    public void validate() throws BusinessException{
        if(StringUtils.isBlank(height)
                || StringUtils.isBlank(weight)
                || StringUtils.isBlank(temperature)
                || StringUtils.isBlank(heartRate)
                || StringUtils.isBlank(highPressure)
                || StringUtils.isBlank(lowPressure)){
            throw new BusinessException(ExceptionCodes.PATIENT_HEALTH_RECORD_BASIINFO);
        }
    }
}
